﻿@model contos.Models.Student

<link href="~/Content/newStyle.css" rel="stylesheet" />
@{
    ViewBag.Title = "Details";
}

<h2>Details</h2>

<fieldset>
    <legend>Student</legend>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.FirstMidName)
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.FirstMidName)
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.LastName)
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.LastName)
    </div>

    <div class="display-label">
         @Html.DisplayNameFor(model => model.EnrollmentDate)
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.EnrollmentDate)
    </div>
    <div class="display-field">
        <table class="gridtable">
            <tr>
                <th>Course Title</th>
                <th>Grade</th>
            </tr>
           @foreach (var item in Model.Enrollments)
           {
               <tr>
                   <td>
                       @Html.DisplayFor(modelitem=>item.Course.Title)
                   </td>
                   <td>
                       @Html.DisplayFor(modeltiem=>item.Grade)
                   </td>
               </tr>
           }
        </table>
    </div>

</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id=Model.StudentID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
